/**
 * Employee class. Extends Person
 *
 * @author	David Alvarez Lopez
 * @date	05-Nov-2006
 *
 */

package com.dekaru.misc.person;

public class Employee extends Person {
	
	int idNumber;
	double salary;
	
    // ==================
    // CLASS CONSTRUCTORS 
    // ==================
	
	/** 
	*A constructor that sets the salary and idNumber to null.
	**/	
	public Employee() {
		
		this.salary = 0d;
		this.idNumber = 0;
	}
	/** 
	* A constructor that sets the name, age and sex to the parameters received.
	*
	* @Param		name	the name of the Person object.
	* @Param		age		the age of the Person object.
	* @Param		sex		the sex of the Person object, true if male, false if female
	**/	
	public Employee(String name, int age, int idNumber, double salary) {
		
		super(name,age);
		this.salary = salary;
		this.idNumber = idNumber;
	}
	
    // ===================
    // GETTERS, SETTERS... 
    // ===================
	
	public void setSalary(double salary) {

		this.salary = salary;
	}
	
	public void setidNumber(int idNumber) {

		this.idNumber = idNumber;
	}
	
	public double getSalary() {
		
		return salary;
	}
	
	public int getIdNumber() {
		
		return idNumber;
	}

    // ====================
    // OTHER USEFUL METHODS 
    // ====================
	
	public String toString() {

		return super.toString() + "-" + getIdNumber() + "-" + this.getSalary();
	}
	
	public boolean equals(Employee obj) {
		
		return ( super.equals(obj) && (this.getSalary() == obj.getSalary()) && (this.getIdNumber() == obj.getIdNumber()) );
	}
}